package pso.mcpso;

import java.util.concurrent.Callable;

import pso.PSOAlgorithm;

public class PSOEpochRunner implements Callable<Void> {

	protected int epochLength;
	protected PSOAlgorithm psoAlgorithm;

	public PSOEpochRunner(PSOAlgorithm psoAlgorithm, int epochLength) {
		super();
		this.epochLength = epochLength;
		this.psoAlgorithm = psoAlgorithm;
	}

	@Override
	public Void call() {
		for (int i = 0; i < epochLength; i++) {
			psoAlgorithm.runIteration();
		}
		return null;
	}

	public int getEpochLength() {
		return epochLength;
	}

	public void setEpochLength(int epochLength) {
		this.epochLength = epochLength;
	}

	public PSOAlgorithm getPSOAlgorithm() {
		return psoAlgorithm;
	}

	public void setPSOAlgorithm(PSOAlgorithm psoAlgorithm) {
		this.psoAlgorithm = psoAlgorithm;
	}
}
